//
//  NoteTapeView.m
//  MansApp
//
//  Created by lanou3g on 15/7/24.
//  Copyright (c) 2015年 ACH. All rights reserved.
//

#import "NoteTapeView.h"

@implementation NoteTapeView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        

        self.imageView = [[UIImageView alloc]initWithFrame:CGRectMake((kWidth - kP6Height(300)) / 2,kP6Height(50), kP6Height(300), kP6Height(150))];
        self.imageView.image = [UIImage imageNamed:@"sound120"];
        self.imageView.userInteractionEnabled = YES;
        self.button = [UIButton buttonWithType:UIButtonTypeSystem];
        self.button.frame = CGRectMake(0,0, kP6Height(100), kP6Height(100));
        self.button.center = self.imageView.center;
        self.button.showsTouchWhenHighlighted = YES;
        
        
        
        [self addSubview:self.imageView];
        [self addSubview:self.button];
    }
    
    return self;
}


- (void)animationStart{
    
    
    NSMutableArray *arr = [NSMutableArray arrayWithObjects:[UIImage imageNamed:@"sound121"],[UIImage imageNamed:@"sound122"],[UIImage imageNamed:@"sound121"],[UIImage imageNamed:@"sound120"], nil];
    
    self.imageView.animationImages = arr;
    self.imageView.animationDuration = 0.4 * arr.count;
    self.imageView.animationRepeatCount = 0;
    
    [self.imageView startAnimating];
    
}

-(void)animationStop{
    
    [self.imageView stopAnimating];
    
    self.imageView.animationImages = nil;
    
}

@end
